package com.wx.wxpush.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wx.wxpush.entiy.UserInfo;
import com.wx.wxpush.mapper.UserInfoMapper;
import com.wx.wxpush.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public  int insertUser(UserInfo userInfo) {
        return userInfoMapper.insertUser(userInfo);
    }

    @Override
    public List<UserInfo> selectAll() {
        return userInfoMapper.selectAll();
    }

    @Override
    public UserInfo selectByNick(String nickname) {
        return userInfoMapper.selectByNick(nickname);
    }

    @Override
    public String selectByopenid(String openid1) {
        return userInfoMapper.selectByopenid(openid1);
    }

//    @Override
//    public PageInfo<UserInfo> selectAllPage(int page, int pagesize) {
//        // TODO Auto-generated method stub
//        PageHelper.startPage(page, pagesize);
//        List<UserInfo> lists = userInfoMapper.selectAllPage();
//        PageInfo<UserInfo> pageInfo = new PageInfo<UserInfo>(lists);
//        return pageInfo;
//
//    }

}
